package com.roc.jpamysql.controller;

import com.roc.jpamysql.model.T1;
import com.roc.jpamysql.service.UserService;
import com.roc.jpamysql.service.impl.UserPlusServiceImpl;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/user")
@Api(tags = "用户模块")
public class UserController {

    @Resource
    private UserService userService;

    @Resource
    private UserPlusServiceImpl userPlusService;

    @GetMapping("/getUser")
    public Integer getUser() {
        return userService.getUser();
    }

    @GetMapping("/saveUser")
    public void saveUser() {
        T1 t1 = new T1().setA(999);
        userPlusService.save(t1);
    }

    @GetMapping("/getUserByWapper")
    public Integer getUserByWapper() {
        return userPlusService.getUserByWapper();
    }

}
